<?php
/*
* Kusht Mud.
* ----
* The MIT License
* Copyright (c) 2010 Andrew Tutt
* ----
*/

/* Exit Class
*
* This is the Game Object for an Exit
*/

// Don't forget: It extends baseobject, 
// so it also has a name, description, etc.

//require_once "BaseObject.class.inc";

class Exit_ extends BaseObject {
	public $tellUser; // tellUser adds 'into' to "You walk into" vs. "You walk"
	public $tellOthers;
	public $command; 	  // What to type to access this exit
	public $commandtgt;   // The proper noun. Like leave "tavern", 
	// target text will be parsed in an "any of" fashion so for 
	// "Esquire's Tavern" all of "Esquire","Esquire's", and "Tavern" will work
	
	public $to_room;  // Room Object !important: Not a vnum
	public $vnum; 	  // A Funky little thing of incredible importance... For identifying things
	public $exit_info; // Int Difficulty Getting Through (OPEN, CLIMB_OVER, CLOSED, BASH_IN, LOCKED, PICK_PROOF)
	public $cKey;      // Int (vnum for the key that opens)

	  function __construct() {
		  $this->discription = "There's nothing particularly interesting in your path.";
	  }

	function setCommonExit($exitkey) {
		// setCommonExit($exitdirection,{$name,$commandext})
		$numargs = func_num_args();
		if($numargs == 1) { $name=""; $commandext=""; }
		if($numargs == 2) { $name=func_get_arg(1); $commandext=func_get_arg(1); }
		if($numargs == 3) { $name=func_get_arg(1); $commandext=func_get_arg(2); }
		
		/*
		* Common Exits
		*/
		// Syntax is: ExitName, ExitCommand, ModifierSelf, ModifierOthers
		// where ModifierSelf is like "You walk into" vs. "You walk"
		$NORTH = array("north","north",""    ,""    );
		$SOUTH = array("south","south",""    ,""    );
		$EAST  = array("east" ,"east" ,""    ,""    );
		$WEST  = array("west" ,"west" ,""    ,""    );
		$UP    = array("up"   ,"up"   ,""    ,""    );
		$DOWN  = array("down" ,"down" ,""    ,""    );
		$ENTER = array(""     ,"enter","into","into");
		$LEAVE = array(""     ,"leave",""    ,""    );
		$EXIT  = array(""     ,"exit" ,""    ,""    );
		$COMMON_EXITS = array(NORTH=>$NORTH,
							  SOUTH=>$SOUTH,
							  EAST =>$EAST,
							  WEST =>$WEST,
							  UP   =>$UP,
							  DOWN =>$DOWN,
							  ENTER=>$ENTER,
							  LEAVE=>$LEAVE,
							  EXIT_=>$EXIT);
		
		$E_Array = $COMMON_EXITS[$exitkey];
		$this->name 			= $E_Array[0].$name;
		$this->command	 		= $E_Array[1];
		$this->commandtgt 		= $commandext;
		$this->tellUser		 	= $E_Array[2];
		$this->tellOthers		= $E_Array[3];
	}
}

?>